package com.ctshk.rpc.order.tour.code;

import com.ctshk.common.enums.ApprovalStatus;

public enum CheckStatusCode {

    WAIT_SUBMIT(1, "待提交"),
    APPROVAL(2, "审批中"),
    APPROVAL_PASS(3, "审批通过"),
    APPROVAL_NOT_PASS(4, "审批不通过"),
            ;

    private Integer code;
    private String msg;

    CheckStatusCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static Integer fromApprovalStatus(Integer code) {
        if(code == ApprovalStatus.REVIEW_YES.getCode()) {
            return APPROVAL_PASS.getCode();
        } else if(code == ApprovalStatus.REVIEW_NO.getCode()) {
            return APPROVAL_NOT_PASS.getCode();
        }
        return null;
    }
}
